﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace NomCafe
{
    public partial class Main_Manager : DevComponents.DotNetBar.Office2007RibbonForm
    {

        frmSystemInformation systemInformation = new frmSystemInformation();
        frmChangePassword changePassword = new frmChangePassword();
        frmAccountInformation accountInformation = new frmAccountInformation();
        frmRegisterUser registerUser = new frmRegisterUser();
        frmShiftManager shiftManager = new frmShiftManager();
        frmAreaManager areaManager = new frmAreaManager();
        frmMarkWork markWork = new frmMarkWork();
        frmTableManager tableManager = new frmTableManager();
        frmDiscountManager discountManager = new frmDiscountManager();
        frmItemTypeManager itemTypeManager = new frmItemTypeManager();
        frmItemManager itemManager = new frmItemManager();
        frmModeManager modeManager = new frmModeManager();
        frmTypeStaff typeStaff = new frmTypeStaff();

        public Main_Manager()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        #region Xử lý show / hide form

        // Xử lý ẩn / hiện form thông tin hệ thống
        private void btnItemSystemInformation_Click(object sender, EventArgs e)
        {
            if (systemInformation.Created == true)
            {
                systemInformation.WindowState = FormWindowState.Maximized;
                systemInformation.Focus();
            }
            else
            {
                itemBtnSysInformation.Visible = true;
                systemInformation.MdiParent = this;
                systemInformation.Show();
            }
        }
        private void itemBtnSysInformation_Click(object sender, EventArgs e)
        {
            if (systemInformation.Created == true)
            {
                systemInformation.WindowState = FormWindowState.Maximized;
                systemInformation.Focus();
            }
            else
            {
                systemInformation.MdiParent = this;
                systemInformation.Show();
            }
        }

        // Xử lý ẩn / hiện form đổi mật khẩu
        private void btnItemChangePassword_Click(object sender, EventArgs e)
        {
            if (changePassword.Created == true)
            {
                changePassword.WindowState = FormWindowState.Maximized;
                changePassword.Focus();
            }
            else
            {
                itemBtnChangePassword.Visible = true;
                changePassword.MdiParent = this;
                changePassword.Show();
            }
        }
        private void itemBtnChangePassword_Click(object sender, EventArgs e)
        {
            if (changePassword.Created == true)
            {
                changePassword.WindowState = FormWindowState.Maximized;
                changePassword.Focus();
            }
            else
            {
                changePassword.MdiParent = this;
                changePassword.Show();
            }
        }

        // Xử lý ẩn / hiện form thông tin tài khoản
        private void btnItemAccountInformation_Click(object sender, EventArgs e)
        {
            if (accountInformation.Created == true)
            {
                accountInformation.WindowState = FormWindowState.Maximized;
                accountInformation.Focus();
            }
            else
            {
                itemBtnAccountInformation.Visible = true;
                accountInformation.MdiParent = this;
                accountInformation.Show();
            }
        }  
        private void itemBtnAccountInformation_Click(object sender, EventArgs e)
        {
            if (accountInformation.Created == true)
            {
                accountInformation.WindowState = FormWindowState.Maximized;
                accountInformation.Focus();
            }
            else
            {
                accountInformation.MdiParent = this;
                accountInformation.Show();
            }
        }

        // Xử lý ẩn / hiện form đăng ký nhân viên
        private void btnItemRegisterUser_Click(object sender, EventArgs e)
        {
            if (registerUser.Created == true)
            {
                registerUser.WindowState = FormWindowState.Maximized;
                registerUser.Focus();
            }
            else
            {
                itemBtnRegisterUser.Visible = true;
                registerUser.MdiParent = this;
                registerUser.Show();
            }
        }
        private void itemBtnRegisterUser_Click(object sender, EventArgs e)
        {
            if (registerUser.Created == true)
            {
                registerUser.WindowState = FormWindowState.Maximized;
                registerUser.Focus();
            }
            else
            {
                registerUser.MdiParent = this;
                registerUser.Show();
            }
        }

        // Xử lý ẩn / hiện form quản lý ca làm việc       
        private void btnItemShiftManager_Click(object sender, EventArgs e)
        {
            if (shiftManager.Created == true)
            {
                shiftManager.WindowState = FormWindowState.Maximized;
                shiftManager.Focus();
            }
            else
            {
                itemBtnShiftManager.Visible = true;
                shiftManager.MdiParent = this;
                shiftManager.Show();
            }
        }
        private void itemBtnShiftManager_Click(object sender, EventArgs e)
        {
            if (shiftManager.Created == true)
            {
                shiftManager.WindowState = FormWindowState.Maximized;
                shiftManager.Focus();                
            }
            else
            {
                shiftManager.MdiParent = this;
                shiftManager.Show();                
            }
        }

        // Xử lý ẩn / hiện form quản lý Khu vực
        private void btnItemAreaManager_Click(object sender, EventArgs e)
        {
            if (areaManager.Created == true)
            {
                areaManager.WindowState = FormWindowState.Maximized;
                areaManager.Focus();
            }
            else
            {
                itemBtnAreaManager.Visible = true;
                areaManager.MdiParent = this;
                areaManager.Show();
            }

        }
        private void itemBtnAreaManager_Click(object sender, EventArgs e)
        {
            if (areaManager.Created == true)
            {
                areaManager.WindowState = FormWindowState.Maximized;
                areaManager.Focus();
            }
            else
            {                
                areaManager.MdiParent = this;
                areaManager.Show();
            }
        }

        // Xử lý ẩn / hiện form chấm công
        private void btnIemMarkWork_Click(object sender, EventArgs e)
        {
            if (markWork.Created == true)
            {
                markWork.WindowState = FormWindowState.Maximized;
                markWork.Focus();
            }
            else
            {
                itemBtnMarkWork.Visible = true;
                markWork.MdiParent = this;
                markWork.Show();
            }
        }
        private void itemBtnMarkWork_Click(object sender, EventArgs e)
        {
            if (markWork.Created == true)
            {
                markWork.WindowState = FormWindowState.Maximized;
                markWork.Focus();
            }
            else
            {
                markWork.MdiParent = this;
                markWork.Show();
            }
        }

        // Xử lý ẩn / hiện form quản lý bàn
        private void btnItemTableManager_Click(object sender, EventArgs e)
        {
            if (tableManager.Created == true)
            {
                tableManager.WindowState = FormWindowState.Maximized;
                tableManager.Focus();
            }
            else
            {
                itemBtnTableManager.Visible = true;
                tableManager.MdiParent = this;
                tableManager.Show();
            }
        }
        private void itemBtnTableManager_Click(object sender, EventArgs e)
        {
            if (tableManager.Created == true)
            {
                tableManager.WindowState = FormWindowState.Maximized;
                tableManager.Focus();
            }
            else
            {
                tableManager.MdiParent = this;
                tableManager.Show();
            }
        }

        // Xử lý ẩn / hiện form chiết khấu khuyến mãi
        private void btnItemDicountManager_Click(object sender, EventArgs e)
        {
            if (discountManager.Created == true)
            {
                discountManager.WindowState = FormWindowState.Maximized;
                discountManager.Focus();
            }
            else
            {
                itemBtnDiscountManager.Visible = true;
                discountManager.MdiParent = this;
                discountManager.Show();
            }
        }
        private void itemBtnDiscountManager_Click(object sender, EventArgs e)
        {
            if (discountManager.Created == true)
            {
                discountManager.WindowState = FormWindowState.Maximized;
                discountManager.Focus();
            }
            else
            {
                discountManager.MdiParent = this;
                discountManager.Show();
            }
        }

        // Xử lý ẩn / hiện form quản lý loại món
        private void itemBtnItemTypeManager_Click(object sender, EventArgs e)
        {
            if (itemTypeManager.Created == true)
            {
                itemTypeManager.WindowState = FormWindowState.Maximized;
                itemTypeManager.Focus();
            }
            else
            {                
                itemTypeManager.MdiParent = this;
                itemTypeManager.Show();
            }
        }
        private void btnItemTypeItemManager_Click(object sender, EventArgs e)
        {
            if (itemTypeManager.Created == true)
            {
                itemTypeManager.WindowState = FormWindowState.Maximized;
                itemTypeManager.Focus();
            }
            else
            {
                itemBtnItemTypeManager.Visible = true;
                itemTypeManager.MdiParent = this;
                itemTypeManager.Show();
            }
        }

        // Xử lý ẩn / hiện form quản lý món
        private void itemBtnItemManager_Click(object sender, EventArgs e)
        {
            if (itemManager.Created == true)
            {
                itemManager.WindowState = FormWindowState.Maximized;
                itemManager.Focus();
            }
            else
            {                
                itemManager.MdiParent = this;
                itemManager.Show();                
            }
        }
        private void btnItemManager_Click(object sender, EventArgs e)
        {
            if (itemManager.Created == true)
            {
                itemManager.WindowState = FormWindowState.Maximized;
                itemManager.Focus();
            }
            else
            {
                itemBtnItemManager.Visible = true;
                itemManager.MdiParent = this;
                itemManager.Show();
            }
        }

        // Xử lý ẩn / hiện form quản lý quy cách
        private void itemBtnModeManager_Click(object sender, EventArgs e)
        {
            if (modeManager.Created == true)
            {
                modeManager.WindowState = FormWindowState.Maximized;
                modeManager.Focus();
            }
            else
            {
                modeManager.MdiParent = this;
                modeManager.Show();
            }
        }
        private void btnItemModeManager_Click(object sender, EventArgs e)
        {
            if (modeManager.Created == true)
            {
                modeManager.WindowState = FormWindowState.Maximized;
                modeManager.Focus();
            }
            else
            {
                itemBtnModeManager.Visible = true;
                modeManager.MdiParent = this;
                modeManager.Show();
            }
        }

        // Xử lý ẩn / hiện form quản lý loại nhân viên
        private void btnTypeStaff_Click(object sender, EventArgs e)
        {
            if (typeStaff.Created == true)
            {
                typeStaff.WindowState = FormWindowState.Maximized;
                typeStaff.Focus();
            }
            else
            {
                itemBtnTypeStaff.Visible = true;
                typeStaff.MdiParent = this;
                typeStaff.Show();
            }
        }
        private void itemBtnTypeStaff_Click(object sender, EventArgs e)
        {
            if (typeStaff.Created == true)
            {
                typeStaff.WindowState = FormWindowState.Maximized;
                typeStaff.Focus();
            }
            else
            {
                typeStaff.MdiParent = this;
                typeStaff.Show();
            }
        }

        #endregion

    }
}
